package com.wsleo.jblog.model.user;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import com.wsleo.jblog.model.BaseModel;
import com.wsleo.jblog.model.common.Status;

/**
 * Article Type
 */
public class User extends BaseModel {
    
    private static final long serialVersionUID = 1L;
    
    private String username;
    private String passwd;
    private String realName;
    private String email;
    private String descript;
    private Status status = Status.NORMAL;
    private Timestamp lastLoginTime;
    private List<UserLog> logs;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public Timestamp getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Timestamp lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public List<UserLog> getLogs() {
		return logs;
	}

	public void setLogs(List<UserLog> logs) {
		this.logs = logs;
	}
	
	@Override
    protected Map<String, Object> ListInsertableFields() {
        Map<String, Object> map = super.ListInsertableFields();
        map.remove("logs");
        return map;
    }

	@Override
	public String toString() {
		return "User [username=" + username + ", passwd=" + passwd
				+ ", realName=" + realName + ", email=" + email + ", descript="
				+ descript + ", statusCode=" + status + ", lastLoginTime="
				+ lastLoginTime + ", createTime=" + getCreateTime()
				+ ", lastUpdTime=" + getLastUpdTime()
				+ ", lastUpdBy=" + getLastUpdBy() + ", id=" + getId()
				+ "]";
	}
	
}
